package com.ruoyi.logistic.service.impl;

import java.util.List;

import com.github.pagehelper.PageHelper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.logistic.domain.NetworkSalesmanTransferMoney;
import com.ruoyi.logistic.domain.PageDate;
import com.ruoyi.logistic.domain.vo.NetworkSalesmanTransferMoneyVo;
import com.ruoyi.logistic.mapper.NetworkSalesmanTransferMoneyMapper;
import com.ruoyi.logistic.service.INetworkSalesmanTransferMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-14
 */
@Service
public class NetworkSalesmanTransferMoneyServiceImpl implements INetworkSalesmanTransferMoneyService
{
    @Autowired
    private NetworkSalesmanTransferMoneyMapper networkSalesmanTransferMoneyMapper;

    @Override
    public List<NetworkSalesmanTransferMoney> search(NetworkSalesmanTransferMoneyVo networkSalesmanTransferMoneyVo) {
        PageHelper.startPage(networkSalesmanTransferMoneyVo.getPageDate());
        List<NetworkSalesmanTransferMoney> networkSalesmanTransferMoneyList = networkSalesmanTransferMoneyMapper.search(networkSalesmanTransferMoneyVo);
        if (networkSalesmanTransferMoneyList != null || networkSalesmanTransferMoneyList.size() != 0){
            for (NetworkSalesmanTransferMoney networkSalesmanTransferMoney : networkSalesmanTransferMoneyList){
                if (networkSalesmanTransferMoneyVo.getCollectType() == 1){
                    networkSalesmanTransferMoney.setCollectTime(networkSalesmanTransferMoneyVo.getStartTime() + "至" + networkSalesmanTransferMoneyVo.getEndTime());
                }else {
                    networkSalesmanTransferMoney.setCollectTime(networkSalesmanTransferMoneyVo.getMonth());
                }
            }
        }
        return networkSalesmanTransferMoneyList;
    }
}
